1. Field of the Invention
The present invention relates to techniques for encoding data. More specifically, the present invention relates to a balanced code for transmitting data that opportunistically reduces the number of signal transitions.
2. Related Art
It is often desirable for data sent across a communication path to be DC-balanced. In particular, a communication will be DC-balanced if a number of transmitted logical ‘1’s equals the number of transmitted logical ‘0’s over a predefined interval (such as over a number of bits or clock cycles). The length of this interval depends on the application and can range, for example, from tens to hundreds of bits. Note that if the pre-defined interval is 40 bits a sequence of 40 transmitted bits must have 20 logical 1s and 20 logical 0s.
As shown in FIG. 1, a commonly used encoding technique that provides DC-balancing is Manchester encoding 100. Under this technique, an encoded bit is represented by a signal transition. For example, a logical 1 may be communicated using a signal transition 110-1 from logical level 112-1 (such as a low signal level) to logical level 112-2 (such as a high signal level). Similarly, a logical 0 may be communicated using a signal transition 110-2 from logical level 112-2 to logical level 112-1. (Note that sometimes the opposite convention is used, in which case a logical 1 is communicated using signal transition 110-2 and logical 0 is communicated using signal transition 110-1.) Consequently, the data bit sequence ‘000’ may be communicated using the encoded sequence ‘101010,’ which includes three cascaded ‘10’ encoded sequences.
Manchester encoding 100 ensures that the encoded sequence is DC-balanced at a very small interval, i.e., two original data bits or four encoded bits. Unfortunately, Manchester encoding 100 has a bandwidth overhead of 100%, which means that every data bit requires two encoded bits. However, in spite of this problem, Manchester encoding 100 is widely used because the circuits for encoding and decoding are very simple and fast. Furthermore, in contrast with other techniques that only guarantee DC-balance over multiple data packets, Manchester encoding 100 guarantees that any given data packet is DC-balanced.
Moreover, Manchester encoding 100 ensures that every encoded bit (such as bits 114) has a signal transition (such as signal transition 110-1 or signal transition 110-2). This property can be used to synchronize a transmitter and a receiver, which is advantageous in systems that require such synchronization. However, in other systems that do not require such synchronization, this guaranteed signal transition may be a problem because it consumes extra power.
One way to view power consumption in VLSI circuits is that energy from a battery or a transformer is used on a chip during the signal transition 110-1 from logical level 112-1 to logical level 112-2 (such as from a low signal level to a high signal level) because such signal transitions drive the voltage of a capacitor with capacitance C up to the chip's power supply voltage Vdd, and this requires energy E which is approximately equal to CVdd2. For example, if we encode a data bit sequence ‘1111’ using Manchester encoding 100, the encoded sequence is ‘01010101,’ which includes four rising signal transitions, and thus, increases power consumption. In contrast, during signal transition 110-2 the voltage stored on the capacitor is simply drained to ground. While this dissipates power, it does not require energy from the power supply.
Note that this description of energy consumption may not apply to all circuits. In particular, if a node is capacitively coupled to the power supply then a downward signal transition (such as the signal transition 110-2) may pull energy from the power supply, and it may be more appropriate to count the total number of signal transitions. Nonetheless, regardless of how the signal transitions are counted the presence of extra signal transitions in the encoded sequence consumes additional power.
In summary, Manchester encoding 100 is a reasonable encoding technique in communication systems that require: simple encoding, per-packet DC-balancing (using guaranteed signal transitions in the encoded bits 114), and/or low-latency. However, this encoding technique has a bandwidth penalty and a power consumption penalty that are prohibitive in many applications.
Hence, what is needed is a method and an apparatus that facilitates DC-balanced encoding without the problems listed above.